# 提供给其它项目引用的共享资源(如果其它项目想通过框架构建引用的话）
if(FRAMEWORK_WANT_INCLUDE)

    if(feature_sparkui)

        list(APPEND FRAMEWORK_INCLUDE_EXPORTS      # 共享的引用目录 - 用于 include
            ${CMAKE_CURRENT_LIST_DIR}/src/
            ${CMAKE_CURRENT_LIST_DIR}/src/components/
        )
        list(APPEND FRAMEWORK_SOURCES_EXPORTS      # 共享的资源文件 - 用于 构建
            ${CMAKE_CURRENT_LIST_DIR}/src/*
            ${CMAKE_CURRENT_LIST_DIR}/src/components/*
        )

    endif(feature_sparkui)    

    return()
endif(FRAMEWORK_WANT_INCLUDE)

# SparkUI 集成式模块: sparkui_integrated
if(feature_sparkui_integrated)
    if(NOT COMMAND target_link_sparkui)
        spark_add_qml_module_path(SparkUI
            ${CMAKE_CURRENT_LIST_DIR}/src/
            ${CMAKE_CURRENT_LIST_DIR}/src/components/
        )
        
        # Qt5
        if(SPARK_FIND_QT5)
            spark_add_links_qt5(
                Quick
            )
            target_link_qt5(SparkUI)
            target_link_qt5_quick(SparkUI)
        endif(SPARK_FIND_QT5)

        set_target_properties(SparkUI
            PROPERTIES
                QMLDIR_CLASSNAME SparkUIPlugin
                LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/SparkUI)
    endif(NOT COMMAND target_link_sparkui)
endif(feature_sparkui_integrated)

# qmlscene 启动器: qmlscene_startup
if(feature_qmlscene_startup)
    if(NOT TARGET qmlscene-startup)
        spark_add_executable(qmlscene-startup
            ${CMAKE_CURRENT_LIST_DIR}/startup/main.cpp
        )
        target_link_qt(qmlscene-startup)

        # 我需要您提供该启动器的详细工作参数
        target_compile_definitions(qmlscene-startup
            PRIVATE
                STARTUP_ATTACH
                STARTUP_WORKDIR="$<IF:$<BOOL:QMLSCENE_STARTUP_WORKDIR>,${QMLSCENE_STARTUP_WORKDIR},${CMAKE_SOURCE_DIR}>"
                STARTUP_QMLFILE="$<IF:$<BOOL:QMLSCENE_STARTUP_QMLFILE>,${QMLSCENE_STARTUP_QMLFILE},${CMAKE_SOURCE_DIR}/main.qml>"
        )
    endif(NOT TARGET qmlscene-startup)
endif(feature_qmlscene_startup)